<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common_tag.jsp"%>
<%@include file="/common/common_js.jsp"%>

<body>
<script type="text/javascript">
	$(function() {
		$('#roomgrid').datagrid( {
			nowrap : false,
			striped : true,
			collapsible : true,
			url : 'classRoom_loadClassRoom.do',
			sortName : 'code',
			sortOrder : 'desc',
			remoteSort : false,
			idField : 'id',
			fitColumns : true,
			fit : true,
			frozenColumns : [ [ {
				field : 'ck',
				checkbox : true
			}] ],
			columns : [ [ {
				field : 'name',
				title : '名称',
				width : 240
			} ] ],
			pagination : true,
			rownumbers : true,
			toolbar : [ {
				id : 'btnadd',
				text : '添加',
				iconCls : 'icon-add',
				handler : function() {
					$('#room_dd').dialog('open');
			}
			}, {
				id : 'btnremove',
				text : '批量删除',
				iconCls : 'icon-remove',
				handler : function() {
					removeMore();
				}
			} ]
		});

		$('#room_dd').dialog( {
			shadow : false,
			title : '添加学生',
			width : 300,
			height : 200,
			buttons : [ {
				text : '提交',
				iconCls : 'icon-ok',
				handler : function() {
					if ($('#roomForm').form('validate')) {
						$.ajax( {
							url : "classRoom_addClassRoom.do",
							type : "post",
							data : $("#roomForm").serialize(),
							datatype : "json",
							success : function(data) {
								alert(data)
							}
						});
					}
				}
			}, {
				text : '取消',
				handler : function() {
					document.getElementById("roomForm").reset();
					$('#room_dd').dialog('close');
				}
			} ]
		});
	});
</script>
	<table id="roomgrid"></table>
	<div id="room_dd" icon="icon-save"   closed="true">
		<form id="roomForm" method="post">
				<table class="formTable" style="margin: 0 auto">
					<tr>
						<td>
							教室名称:
						</td>
						<td>
							<input name="room.name" type="text" class="easyui-validatebox" required="true" />
						</td>
					</tr>
				</table>
		</form>
	</div>

</body>
